import request from "@/utils/request.js";

export const orderInfoGetByUserId = (userId) =>
    request.get(`/goods/order/${userId}`)

export const orderDeleteById = (id) =>
    request.delete(`/goods/order/${id}`)

export const orderCancelById = (id, status) =>
    request.put(`/goods/status`, {
        id,
        status
    })

/**
 * 分页查询
 * @param page
 * @param pageSize
 * @param userId
 * @returns {Promise<axios.AxiosResponse<any>>}
 */
export const orderPageQuery = (page, pageSize, userId) =>
    request.get(`/goods/page`, {
        params: { page, pageSize, userId }
    })